-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter pods by labelSelector #510
Filter pods by labelSelector #510
Conversation
if (len(includedNamespaces) > 0 && !includedNamespaces.Has(namespace.Name)) || | ||
(len(excludedNamespaces) > 0 && excludedNamespaces.Has(namespace.Name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modify this to pass cyclomatic complexity check.
@lixiang233 is this PR ready for review? |
yes, PTAL when you have time. |
/cc @ingvagabund |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing to set label selector in RemoveDuplicates
and RemovePodsViolatingTopologySpreadConstraint
improperly might result in the opposite of what those strategies wants to achieve. The skew of pods between topology domains might actually increase.
You are right, so should we mention this in README to tell users the risk of using this parameter or just disable it in these strategies? |
769239f
to
2cdaeb9
Compare
Disable it in these strategies. |
To disable. We don't want to allow users to configure a strategy the way it malfunctions. |
2cdaeb9
to
c2de29c
Compare
Disabled. PTAL @ingvagabund @seanmalloy |
Worth changing |
…tion, RemoveDuplicates and RemovePodsViolatingTopologySpreadConstraint.
c2de29c
to
29ade13
Compare
updated. |
I think this looks all good to me, anyone else have any suggestions? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, lixiang233, seanmalloy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It looks good to me. I did not find anything that needs changing. I'll give @ingvagabund some time to review just in case he wants to take one more look. Also FYI @killianmuldoon the long awaited label filtering feature that you suggested has been implemented. Feel free to review if you have time. Thanks! /cc @killianmuldoon |
@seanmalloy: GitHub didn't allow me to request PR reviews from the following users: killianmuldoon. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm Thank you @lixiang233!!! |
calcContainerRestarts sums over containers. The new language makes that clear, avoiding potential confusion vs. an altenative that looked for pods where a single container had passed the configured threshold. For example, with three containers with 50 restarts and a threshold of 100, the actual "sum over containers" logic makes that pod a candidate for descheduling, but the "largest single container restart count" hypothetical would not have made it a candidate. Also shifts labelSelector into the parameter table, because when it was added in 29ade13 (README and e2e-testcase add for labelSelector, 2021-03-02, kubernetes-sigs#510), it landed a few lines too high.
…abel Filter pods by labelSelector
calcContainerRestarts sums over containers. The new language makes that clear, avoiding potential confusion vs. an altenative that looked for pods where a single container had passed the configured threshold. For example, with three containers with 50 restarts and a threshold of 100, the actual "sum over containers" logic makes that pod a candidate for descheduling, but the "largest single container restart count" hypothetical would not have made it a candidate. Also shifts labelSelector into the parameter table, because when it was added in 29ade13 (README and e2e-testcase add for labelSelector, 2021-03-02, kubernetes-sigs#510), it landed a few lines too high.
Fixes: #195
TODO:
/kind feature